package com.itbaizhan.dao;

import com.itbaizhan.entity.MembersInfo;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author luo20
 */
@Repository
public interface MembersInfoDao {
    //查询所有会员信息
    @Select("select * from membersinfo;")
    List<MembersInfo> findAll();

    //根据会员编号查询会员信息
    @Select("select * from membersinfo where id = #{id};")
    MembersInfo findById(@Param("id")Integer id);

    //修改指定会员信息
    int updateByMembersInfo(MembersInfo membersInfo);

    //删除指定会员的信息
    @Delete("delete from membersinfo where id = #{id};")
    int deleteById(@Param("id") Integer id);
}
